package com.bjsc.entity.model;

import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * @author create by VIC.Huang
 * @date 2018/2/28
 */
@Data
public class BetRecord implements Serializable {
    private Long playerId;
    private String playerName;

    private String createTime;
    private String gameTitle;
    private String betNum;
    private Integer amount;
    private BigDecimal perPrice;
    private String orderNo;
    private String issueNo;
    private String openCode;
    private String winStatus;
    private BigDecimal winPrice;

    private BigDecimal totalPrice;
    public BigDecimal getTotalPrice() {
        return perPrice.multiply(new BigDecimal(amount));
    }

    public String getBetNum() {
        if(TWO.containsKey(betNum)) {
            return "尾数：" + TWO.get(betNum);
        }else if(FOUR.containsKey(betNum)) {
            return "后两位：" + FOUR.get(betNum);
        }else if(TEN.containsKey(betNum)) {
            return "尾数：" + TEN.get(betNum);
        }
        return "";
    }

    /**
     * 双人夺宝
     */
    public static final Map<String, String> TWO = new HashMap<String, String>() {
        {
            put("max", "大数");
            put("min", "小数");
            put("odd", "单数");
            put("even", "双数");
        }
    };
    /**
     * 四人夺宝
     */
    public static final Map<String, String> FOUR = new HashMap<String, String>() {
        {
            put("max_odd", "大单");
            put("max_even", "大双");
            put("min_odd", "小单");
            put("min_even", "小双");
        }
    };
    /**
     * 十人夺宝
     */
    public static final Map<String, String> TEN = new HashMap<String, String>() {
        {
            put("10", "10");
            put("1", "1");
            put("2", "2");
            put("3", "3");
            put("4", "4");
            put("5", "5");
            put("6", "6");
            put("7", "7");
            put("8", "8");
            put("9", "9");
        }
    };
}
